home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / snip9_91.arc / SCRNSIZE.C < prev    next >
C/C++ Source or Header  |  1991-09-17  |  452b  |  26 lines

  1. /*
  2. **   Get screen size (by  Bob Jarvis)
  3. */
  4.  
  5. #include <dos.h>
  6.  
  7. int get_screen_rows(void)
  8. {
  9.         char far *bios_crt_rows_ptr = MK_FP(0x0040, 0x0084);
  10.  
  11.         return(*bios_crt_rows_ptr);
  12. }
  13.  
  14. int get_screen_cols(void)
  15. {
  16.         int far *bios_crt_cols_ptr = MK_FP(0x0040, 0x004A);
  17.  
  18.         return(*bios_crt_cols_ptr);
  19. }
  20.  
  21. main()
  22. {
  23.         printf("rows = %d  cols = %d\n",
  24.                 get_screen_rows(), get_screen_cols());
  25. }
  26.